package com.gwt.client;

import java.io.Serializable;

import com.google.gwt.view.client.ProvidesKey;

public class ItemInfo implements Comparable<ItemInfo>, Serializable {
	private static final long serialVersionUID = 3L;

	public static final ProvidesKey<ItemInfo> KEY_PROVIDER = new ProvidesKey<ItemInfo>() {
	      public Object getKey(ItemInfo item) {
	        return item == null ? null : item.getName();
	      }
    };
		
	private String name;
	
	public ItemInfo(){
		this.name="";
	}
	
	public ItemInfo(String name){
		this.name=name;
	}
		
	public String getName(){
		return name;
	}
		
	public int compareTo(ItemInfo o) {
		return (o == null || o.name == null) ? -1 : -o.name.compareTo(name);
	}
}


